package com.bflow.api.example;

import com.bflow.api.bo.*;
import com.bflow.api.bo.example.ExampleLeaveBo;
import com.bflow.commons.bean.PageResult;
import com.bflow.commons.exception.BizException;

/**
 * 功能：IExampleLeaveService 示例请假流程定义-业务接口
 * 作者：liaofeng
 * 日期：2018-12-19
 */
public interface IExampleLeaveService {

    /**
     * 查询历史记录列表
     *
     * @param queryParam
     * @return
     * @throws BizException
     */
    PageResult<BflowRunInstanceBo> findHistoryList(BflowRunInstanceQueryParam queryParam) throws BizException;

    /**
     * 查询审批列表
     * @param queryParam
     * @param userKey 用户key
     * @return
     * @throws BizException
     */
    PageResult<BflowRunTaskBo> findAuditList(BflowRunTaskQueryParam queryParam, String userKey) throws BizException;

    /**
     * 提交请假申请
     *
     * @param leaveBo
     * @throws BizException
     */
    void addLeave(ExampleLeaveBo leaveBo) throws BizException;

    /**
     * 审批请假
     * @param bo
     * @throws BizException
     */
    void audit(BflowRunTaskAuditBo bo) throws BizException;

    /**
     * 详情
     * @param instanceId
     * @param userId
     * @return
     * @throws BizException
     */
    BflowRunInstanceBo detail(String instanceId, String userId) throws BizException;

    /**
     * 获取task任务数据
     * @param taskId
     * @return
     * @throws BizException
     */
    BflowRunTaskBo getRunTaskDetail(String taskId, String userId) throws BizException;

    /**
     * 查询我的请假历史记录列表
     *
     * @param queryParam
     * @return
     * @throws BizException
     */
    PageResult<BflowRunInstanceBo> findMyHistoryList(BflowRunInstanceQueryParam queryParam, String userId) throws BizException;

    /**
     * 查询抄送给我的请假列表
     * @param queryParam
     * @param userId
     * @return
     * @throws BizException
     */
    PageResult<BflowDefineProcessBo> findCopyToMeList(BflowDefineProcessQueryParam queryParam, String userId) throws BizException;
}
